
<!-- BEGIN:main -->

<script>

    $(function() {
        $("#txtCreatedDate").datepicker({
            changeMonth: true,
            changeYear: true
        });
    });

    function submitForm(ac)
    {
        var albumID = $("#slCategoryID");
        var image = $("#txtImage");
        var width = $("#txtWidth");
        var height = $("#txtHeight");

        var arrayInput = new Array(albumID, image, width, height);

        var hasError = validateEmptyValue(arrayInput);

        if (hasError) {
            alert("Vui lòng điền đầy đủ thông tin");
        } else {
            var form = document.phpForm;
            form.hdAction.value = ac;
            form.submit();
        }


    }

    function BrowseImage() {
        var finder = new CKFinder();
        finder.BasePath = '../blugin/ckeditor3.6.4/ckfinder/';
        finder.startupPath = "Albums/albums/";
        finder.SelectFunction = SetImageField;
        finder.Popup();
    }


    function SetImageField(fileUrl) {
        document.getElementById('txtImage').value = fileUrl;
        document.getElementById('hdImage').value = fileUrl;
    }


</script>


<div id="toolbar-box">
    <div class="d_divide5"></div>
    <div class="toolbar" id="toolbar">
        <table class="toolbar">
            <tr>
                <td class="button" id="toolbar-save">
                    <a href="javascript:void()" onclick="submitForm('addAndExit')" class="toolbar">
                        <span class="icon-32-save" title="Lưu"></span>
                        Lưu & Đóng
                    </a>
                </td>

                <td class="button" id="toolbar-apply">
                    <a href="javascript:void()" onclick="submitForm('add')" class="toolbar">
                        <span class="icon-32-apply" title="Lưu"></span>
                        Lưu
                    </a>
                </td>

                <td class="button" id="toolbar-cancel">
                    <a href=".?com=com_image&view=image&task=view&categoryID={CATEGORY_ID}" class="toolbar">
                        <span class="icon-32-cancel" title="Hủy"></span>
                        Hủy
                    </a>
                </td>												
            </tr>
        </table>
    </div>
    <div class="header icon_48_image_add">
        Ảnh: <small><small>[ Thêm mới ]</small></small>

    </div>

    <div class="d_divide5"></div>
</div>

<div class="d_divide10"></div>
<div class="d_clear"></div>

<div id="element-box">


    <form method="post" name="phpForm">

        <table cellspacing="0" cellpadding="0" border="0" width="100%">
            <tr>
                <td valign="top">     

                    <!--left column-->
                    <div style="width: 100%; float:left;">
                        <fieldset>

                            <legend>Thông tin cơ bản</legend>

                            <div class="d_divide2"></div>

                            <!--category-->
                            <div>
                                <label for="slCategoryID" class="d_label">Album ảnh: <b style="color:red">*</b></label>
                                <select size="1" style="width: 300px;" class="d_text_input" name="slCategoryID" id="slCategoryID">
                                    <option value="0" selected>-- Chọn Album ảnh --</option>
                                    <!-- BEGIN:category_list -->
                                    <OPTION {SELECTED_CATEGORY} value={CATEGORY_ID}>{CATEGORY_TITLE}</OPTION>                                            
                                    <!-- END:category_list -->
                                </select>   
                            </div>   


                            <div class="d_divide2"></div>

                            <div>
                                <label for="txtImage" class="d_label">Hình ảnh: <b style="color: red;">*</b></label>
                                <input class="d_text_input" readonly="true" type="text" id="txtImage" name="txtImage" value="" disabled="disabled" size="50"/>
                                <input id="btBrowseImage" class="d_button" type="button" onClick="javascript:BrowseImage();" value="Chọn" />
                                <input type="hidden" id="hdImage" name="hdImage" value=""/>
                            </div>




                            <div class="d_divide2"></div>

                            <!--title-->
                            <div>
                                <label for="txtTitle" class="d_label">Tiêu đề:</label>
                                <input class="d_text_input" name="txtTitle" id="txtTitle" style="width: 300px;"  />                                
                            </div>


                            <div class="d_divide2"></div>


                            <!--size-->
                            <div>
                                <label for="txtWidth" class="d_label">Rộng</label> 
                                <input style="float: left" onkeypress="return keypress(event);" type="text" size="10" value="700" name="txtWidth" id="txtWidth" class="d_text_input"> 
                                <label for="txtHeight" class="d_label" style="width: 105px">Cao: </label>
                                <input style="float: left" onkeypress="return keypress(event);" type="text" size="10" value="700" name="txtHeight" id="txtHeight" class="d_text_input">
                            </div>


                            <div class="d_divide2"></div>

                            <!--title-->
                            <div>
                                <label for="txtDescription" class="d_label">Mô tả ảnh:</label>
                                <textarea class="d_text_input" name="txtDescription" id="txtDescription" style="width: 300px;"></textarea>
                            </div>                  

                            <div class="d_divide2"></div>

                            <!--status-->
                            <div>
                                <label class="d_label">Hiển thị</label>
                                <input type="radio" name="rdoStatus" id="rdoState" value="0"  />
                                <label >Không</label>
                                <input type="radio" name="rdoStatus" id="rdoState" value="1" checked="checked"  />
                                <label >Có</label>
                            </div>

                            <div class="d_divide2"></div>

                            <!-- created date -->
                            <div>
                                <label for="txtCreatedDate" class="d_label">Ngày tạo</label>
                                <input readonly="true" class="d_text_input" value="{TODAY}"  name="txtCreatedDate" id="txtCreatedDate" style="width: 100px;"  />                                
                            </div> 

                        </fieldset>
                    </div> 
                    <!-- end left column-->




                </td>            
            </tr>
        </table>
        <input type="hidden" name="hdAction" value=""/>
    </form>

</div>
<noscript>
!Cảnh báo! Javascript phải được bật để chạy được các chức năng trong phần Quản trị		</noscript>

<!-- END:main -->